<div class="portlet-content">           

  <div class="table-responsive">

    <h4 class="heading"><?php echo $exemple->intitule(); ?></h4> 
    <form action='partie_save.php' method='post' id="partie-save">
     <div class="row" align="center">
     <div class="col-lg-2"><input type="submit" value="TERMINER L'EXERCICE" /></div>
     <?php if(isset($_GET['ex'])){ ?>
     <div class="col-lg-2"><input type="text" name="minutes" id="minutes" /> minutes</div>
     <div class="col-lg-2"><input type="text" name="secondes" id="secondes" /> secondes</div>
     <?php } ?>
     </div>
     <input type="text" name="idRefTest" value="<?php echo $acces->idRefTest(); ?>" hidden/>   
	 <input type='text' name='idExercice' value='<?php echo $exemple->id(); ?>' hidden/>	 
    <hr/>        
                                
    <ul id="myTab1" class="nav nav-tabs">
        <?php
            for($i=1;$i<=$exercicemanager->getNbQuestion($exemple->id());$i++){
                if($i==1){$type = "class='active'";}else{$type = "";}
                echo"
                <li ".$type."'>
                  <a href='#".$i."' data-toggle='tab'>".$i."</a>
                </li>";						
            }
        ?>
        
    </ul>

    <div id="myTab1Content" class="tab-content">

        <?php
        
        for($i=1;$i<=$exercicemanager->getNbQuestion($exemple->id());$i++){
            $TabQuest = $questionmanager->getByExercice($exemple->id());
            $TabRep = $reponsemanager->getByQuestion($TabQuest[$i-1]->id());
            if($i==1){$type = "class='tab-pane fade in active'";}else{$type = "class='tab-pane fade'";}
            
                if (file_exists($TabQuest[$i-1]->image())){ // on regarde si c'est une image ou non
                    $QImage =  "<img src='".$TabQuest[$i-1]->image()."' width=500px />";
                }
                else{$QImage = "Aucune Image";}						
                ?>
                <div <?php echo $type; ?> id='<?php echo $i; ?>'>
                    <p>Question "<?php echo $i; ?>" :</p>
                <?php echo	"<p>".$TabQuest[$i-1]->contenu()."<br/>"
                        .$QImage."
                    </p>"; ?>
                    
                    <table border='1' >

                    <?php	
					
					//Si c'est un exemple, affiché les réponses
					if(!isset($_GET['ex']))
					{
						$repJuste = $reponsemanager->getJuste($TabQuest[$i-1]->id());
						$repJuste = explode('/',$repJuste[0]->contenu());
						$val1 = " value='".$repJuste[0]."'";
						$val2 = " value='".$repJuste[1]."'";
						$disabled = " disabled";
					} else {
						$val1 = "";
						$val2 = "";
						$disabled = "";
					}
					                 
					echo "						
							<tr>
								<td style='padding:3px'>
									<input type='text' name='domino1quest".$TabQuest[$i-1]->id()."'".$val1.$disabled."/>";
		if(!isset($_GET['ex'])){echo "<input type='text' name='domino1quest".$TabQuest[$i-1]->id()."'".$val1." hidden/>";}
					echo "		</td>								
							</tr>
							<tr>							
								<td style='padding:3px'>
									<input type='text' name='domino2quest".$TabQuest[$i-1]->id()."'".$val2.$disabled."/>";
		if(!isset($_GET['ex'])){echo "<input type='text' name='domino2quest".$TabQuest[$i-1]->id()."'".$val2." hidden/>";}
					echo "		</td>
							</tr>
						";
                     ?>
        
                    </table>							
                </div>
            
<?php	} ?>
        
        
    </div>
    
        </form>

  </div> <!-- /.table-responsive -->

</div> <!-- /.portlet-content -->